const KoaRouter = require('@koa/router')
const { hanlePhoto } = require("../middleware/upload.middleware");
const uploadController = require('../controller/upload.controller');
const { verify } = require('jsonwebtoken');
const fileRouter = new KoaRouter({ prefix: "/upload" });
// 上传照片
fileRouter.post(
  "/photo/:id",
  verify,
  hanlePhoto,
  uploadController.created
);

// 根据id查看照片
fileRouter.get('/photo/:id', uploadController.showImageById)


module.exports = fileRouter;
